########## MACROS ###########################################################################
#############################################################################################

function(conan_message MESSAGE_OUTPUT)
    if(NOT CONAN_CMAKE_SILENT_OUTPUT)
        message(${ARGV${0}})
    endif()
endfunction()


macro(conan_find_apple_frameworks FRAMEWORKS_FOUND FRAMEWORKS FRAMEWORKS_DIRS)
    if(APPLE)
        foreach(_FRAMEWORK ${FRAMEWORKS})
            # https://cmake.org/pipermail/cmake-developers/2017-August/030199.html
            find_library(CONAN_FRAMEWORK_${_FRAMEWORK}_FOUND NAMES ${_FRAMEWORK} PATHS ${FRAMEWORKS_DIRS} CMAKE_FIND_ROOT_PATH_BOTH)
            if(CONAN_FRAMEWORK_${_FRAMEWORK}_FOUND)
                list(APPEND ${FRAMEWORKS_FOUND} ${CONAN_FRAMEWORK_${_FRAMEWORK}_FOUND})
            else()
                message(FATAL_ERROR "Framework library ${_FRAMEWORK} not found in paths: ${FRAMEWORKS_DIRS}")
            endif()
        endforeach()
    endif()
endmacro()


function(conan_package_library_targets libraries package_libdir deps out_libraries out_libraries_target build_type package_name)
    unset(_CONAN_ACTUAL_TARGETS CACHE)
    unset(_CONAN_FOUND_SYSTEM_LIBS CACHE)
    foreach(_LIBRARY_NAME ${libraries})
        find_library(CONAN_FOUND_LIBRARY NAMES ${_LIBRARY_NAME} PATHS ${package_libdir}
                     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
        if(CONAN_FOUND_LIBRARY)
            conan_message(STATUS "Library ${_LIBRARY_NAME} found ${CONAN_FOUND_LIBRARY}")
            list(APPEND _out_libraries ${CONAN_FOUND_LIBRARY})
            if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
                # Create a micro-target for each lib/a found
                string(REGEX REPLACE "[^A-Za-z0-9.+_-]" "_" _LIBRARY_NAME ${_LIBRARY_NAME})
                set(_LIB_NAME CONAN_LIB::${package_name}_${_LIBRARY_NAME}${build_type})
                if(NOT TARGET ${_LIB_NAME})
                    # Create a micro-target for each lib/a found
                    add_library(${_LIB_NAME} UNKNOWN IMPORTED)
                    set_target_properties(${_LIB_NAME} PROPERTIES IMPORTED_LOCATION ${CONAN_FOUND_LIBRARY})
                    set(_CONAN_ACTUAL_TARGETS ${_CONAN_ACTUAL_TARGETS} ${_LIB_NAME})
                else()
                    conan_message(STATUS "Skipping already existing target: ${_LIB_NAME}")
                endif()
                list(APPEND _out_libraries_target ${_LIB_NAME})
            endif()
            conan_message(STATUS "Found: ${CONAN_FOUND_LIBRARY}")
        else()
            conan_message(STATUS "Library ${_LIBRARY_NAME} not found in package, might be system one")
            list(APPEND _out_libraries_target ${_LIBRARY_NAME})
            list(APPEND _out_libraries ${_LIBRARY_NAME})
            set(_CONAN_FOUND_SYSTEM_LIBS "${_CONAN_FOUND_SYSTEM_LIBS};${_LIBRARY_NAME}")
        endif()
        unset(CONAN_FOUND_LIBRARY CACHE)
    endforeach()

    if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
        # Add all dependencies to all targets
        string(REPLACE " " ";" deps_list "${deps}")
        foreach(_CONAN_ACTUAL_TARGET ${_CONAN_ACTUAL_TARGETS})
            set_property(TARGET ${_CONAN_ACTUAL_TARGET} PROPERTY INTERFACE_LINK_LIBRARIES "${_CONAN_FOUND_SYSTEM_LIBS};${deps_list}")
        endforeach()
    endif()

    set(${out_libraries} ${_out_libraries} PARENT_SCOPE)
    set(${out_libraries_target} ${_out_libraries_target} PARENT_SCOPE)
endfunction()


########### FOUND PACKAGE ###################################################################
#############################################################################################

include(FindPackageHandleStandardArgs)

conan_message(STATUS "Conan: Using autogenerated Findlibunwind.cmake")
set(libunwind_FOUND 1)
set(libunwind_VERSION "1.7.2")

find_package_handle_standard_args(libunwind REQUIRED_VARS
                                  libunwind_VERSION VERSION_VAR libunwind_VERSION)
mark_as_advanced(libunwind_FOUND libunwind_VERSION)

set(libunwind_COMPONENTS libunwind::ptrace libunwind::setjmp libunwind::coredump libunwind::generic libunwind::unwind)

if(libunwind_FIND_COMPONENTS)
    foreach(_FIND_COMPONENT ${libunwind_FIND_COMPONENTS})
        list(FIND libunwind_COMPONENTS "libunwind::${_FIND_COMPONENT}" _index)
        if(${_index} EQUAL -1)
            conan_message(FATAL_ERROR "Conan: Component '${_FIND_COMPONENT}' NOT found in package 'libunwind'")
        else()
            conan_message(STATUS "Conan: Component '${_FIND_COMPONENT}' found in package 'libunwind'")
        endif()
    endforeach()
endif()

########### VARIABLES #######################################################################
#############################################################################################


set(libunwind_INCLUDE_DIRS "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/include")
set(libunwind_INCLUDE_DIR "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/include")
set(libunwind_INCLUDES "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/include")
set(libunwind_RES_DIRS )
set(libunwind_DEFINITIONS )
set(libunwind_LINKER_FLAGS_LIST
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:>"
)
set(libunwind_COMPILE_DEFINITIONS )
set(libunwind_COMPILE_OPTIONS_LIST "" "")
set(libunwind_COMPILE_OPTIONS_C "")
set(libunwind_COMPILE_OPTIONS_CXX "")
set(libunwind_LIBRARIES_TARGETS "") # Will be filled later, if CMake 3
set(libunwind_LIBRARIES "") # Will be filled later
set(libunwind_LIBS "") # Same as libunwind_LIBRARIES
set(libunwind_SYSTEM_LIBS pthread)
set(libunwind_FRAMEWORK_DIRS )
set(libunwind_FRAMEWORKS )
set(libunwind_FRAMEWORKS_FOUND "") # Will be filled later
set(libunwind_BUILD_MODULES_PATHS )

conan_find_apple_frameworks(libunwind_FRAMEWORKS_FOUND "${libunwind_FRAMEWORKS}" "${libunwind_FRAMEWORK_DIRS}")

mark_as_advanced(libunwind_INCLUDE_DIRS
                 libunwind_INCLUDE_DIR
                 libunwind_INCLUDES
                 libunwind_DEFINITIONS
                 libunwind_LINKER_FLAGS_LIST
                 libunwind_COMPILE_DEFINITIONS
                 libunwind_COMPILE_OPTIONS_LIST
                 libunwind_LIBRARIES
                 libunwind_LIBS
                 libunwind_LIBRARIES_TARGETS)

# Find the real .lib/.a and add them to libunwind_LIBS and libunwind_LIBRARY_LIST
set(libunwind_LIBRARY_LIST unwind-ptrace unwind-setjmp unwind-coredump unwind-generic unwind)
set(libunwind_LIB_DIRS "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/lib")

# Gather all the libraries that should be linked to the targets (do not touch existing variables):
set(_libunwind_DEPENDENCIES "${libunwind_FRAMEWORKS_FOUND} ${libunwind_SYSTEM_LIBS} LibLZMA::LibLZMA;ZLIB::ZLIB")

conan_package_library_targets("${libunwind_LIBRARY_LIST}"  # libraries
                              "${libunwind_LIB_DIRS}"      # package_libdir
                              "${_libunwind_DEPENDENCIES}"  # deps
                              libunwind_LIBRARIES            # out_libraries
                              libunwind_LIBRARIES_TARGETS    # out_libraries_targets
                              ""                          # build_type
                              "libunwind")                                      # package_name

set(libunwind_LIBS ${libunwind_LIBRARIES})

foreach(_FRAMEWORK ${libunwind_FRAMEWORKS_FOUND})
    list(APPEND libunwind_LIBRARIES_TARGETS ${_FRAMEWORK})
    list(APPEND libunwind_LIBRARIES ${_FRAMEWORK})
endforeach()

foreach(_SYSTEM_LIB ${libunwind_SYSTEM_LIBS})
    list(APPEND libunwind_LIBRARIES_TARGETS ${_SYSTEM_LIB})
    list(APPEND libunwind_LIBRARIES ${_SYSTEM_LIB})
endforeach()

# We need to add our requirements too
set(libunwind_LIBRARIES_TARGETS "${libunwind_LIBRARIES_TARGETS};LibLZMA::LibLZMA;ZLIB::ZLIB")
set(libunwind_LIBRARIES "${libunwind_LIBRARIES};LibLZMA::LibLZMA;ZLIB::ZLIB")

set(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH})
set(CMAKE_PREFIX_PATH  ${CMAKE_PREFIX_PATH})


########### COMPONENT unwind VARIABLES #############################################

set(libunwind_unwind_INCLUDE_DIRS "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/include")
set(libunwind_unwind_INCLUDE_DIR "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/include")
set(libunwind_unwind_INCLUDES "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/include")
set(libunwind_unwind_LIB_DIRS "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/lib")
set(libunwind_unwind_RES_DIRS )
set(libunwind_unwind_DEFINITIONS )
set(libunwind_unwind_COMPILE_DEFINITIONS )
set(libunwind_unwind_COMPILE_OPTIONS_C "")
set(libunwind_unwind_COMPILE_OPTIONS_CXX "")
set(libunwind_unwind_LIBS unwind)
set(libunwind_unwind_SYSTEM_LIBS pthread)
set(libunwind_unwind_FRAMEWORK_DIRS )
set(libunwind_unwind_FRAMEWORKS )
set(libunwind_unwind_BUILD_MODULES_PATHS )
set(libunwind_unwind_DEPENDENCIES LibLZMA::LibLZMA ZLIB::ZLIB)
set(libunwind_unwind_LINKER_FLAGS_LIST
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:>"
)

########### COMPONENT generic VARIABLES #############################################

set(libunwind_generic_INCLUDE_DIRS "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/include")
set(libunwind_generic_INCLUDE_DIR "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/include")
set(libunwind_generic_INCLUDES "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/include")
set(libunwind_generic_LIB_DIRS "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/lib")
set(libunwind_generic_RES_DIRS )
set(libunwind_generic_DEFINITIONS )
set(libunwind_generic_COMPILE_DEFINITIONS )
set(libunwind_generic_COMPILE_OPTIONS_C "")
set(libunwind_generic_COMPILE_OPTIONS_CXX "")
set(libunwind_generic_LIBS unwind-generic)
set(libunwind_generic_SYSTEM_LIBS )
set(libunwind_generic_FRAMEWORK_DIRS )
set(libunwind_generic_FRAMEWORKS )
set(libunwind_generic_BUILD_MODULES_PATHS )
set(libunwind_generic_DEPENDENCIES libunwind::unwind)
set(libunwind_generic_LINKER_FLAGS_LIST
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:>"
)

########### COMPONENT coredump VARIABLES #############################################

set(libunwind_coredump_INCLUDE_DIRS "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/include")
set(libunwind_coredump_INCLUDE_DIR "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/include")
set(libunwind_coredump_INCLUDES "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/include")
set(libunwind_coredump_LIB_DIRS "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/lib")
set(libunwind_coredump_RES_DIRS )
set(libunwind_coredump_DEFINITIONS )
set(libunwind_coredump_COMPILE_DEFINITIONS )
set(libunwind_coredump_COMPILE_OPTIONS_C "")
set(libunwind_coredump_COMPILE_OPTIONS_CXX "")
set(libunwind_coredump_LIBS unwind-coredump)
set(libunwind_coredump_SYSTEM_LIBS )
set(libunwind_coredump_FRAMEWORK_DIRS )
set(libunwind_coredump_FRAMEWORKS )
set(libunwind_coredump_BUILD_MODULES_PATHS )
set(libunwind_coredump_DEPENDENCIES libunwind::generic libunwind::unwind)
set(libunwind_coredump_LINKER_FLAGS_LIST
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:>"
)

########### COMPONENT setjmp VARIABLES #############################################

set(libunwind_setjmp_INCLUDE_DIRS "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/include")
set(libunwind_setjmp_INCLUDE_DIR "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/include")
set(libunwind_setjmp_INCLUDES "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/include")
set(libunwind_setjmp_LIB_DIRS "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/lib")
set(libunwind_setjmp_RES_DIRS )
set(libunwind_setjmp_DEFINITIONS )
set(libunwind_setjmp_COMPILE_DEFINITIONS )
set(libunwind_setjmp_COMPILE_OPTIONS_C "")
set(libunwind_setjmp_COMPILE_OPTIONS_CXX "")
set(libunwind_setjmp_LIBS unwind-setjmp)
set(libunwind_setjmp_SYSTEM_LIBS )
set(libunwind_setjmp_FRAMEWORK_DIRS )
set(libunwind_setjmp_FRAMEWORKS )
set(libunwind_setjmp_BUILD_MODULES_PATHS )
set(libunwind_setjmp_DEPENDENCIES libunwind::unwind)
set(libunwind_setjmp_LINKER_FLAGS_LIST
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:>"
)

########### COMPONENT ptrace VARIABLES #############################################

set(libunwind_ptrace_INCLUDE_DIRS "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/include")
set(libunwind_ptrace_INCLUDE_DIR "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/include")
set(libunwind_ptrace_INCLUDES "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/include")
set(libunwind_ptrace_LIB_DIRS "/root/.conan/data/libunwind/1.7.2/_/_/package/878d6c4a052c8281caa0c414a09b670a36fe2bc7/lib")
set(libunwind_ptrace_RES_DIRS )
set(libunwind_ptrace_DEFINITIONS )
set(libunwind_ptrace_COMPILE_DEFINITIONS )
set(libunwind_ptrace_COMPILE_OPTIONS_C "")
set(libunwind_ptrace_COMPILE_OPTIONS_CXX "")
set(libunwind_ptrace_LIBS unwind-ptrace)
set(libunwind_ptrace_SYSTEM_LIBS )
set(libunwind_ptrace_FRAMEWORK_DIRS )
set(libunwind_ptrace_FRAMEWORKS )
set(libunwind_ptrace_BUILD_MODULES_PATHS )
set(libunwind_ptrace_DEPENDENCIES libunwind::generic libunwind::unwind)
set(libunwind_ptrace_LINKER_FLAGS_LIST
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:>"
        "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:>"
)


########## FIND PACKAGE DEPENDENCY ##########################################################
#############################################################################################

include(CMakeFindDependencyMacro)

if(NOT LibLZMA_FOUND)
    find_dependency(LibLZMA REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency LibLZMA already found")
endif()

if(NOT ZLIB_FOUND)
    find_dependency(ZLIB REQUIRED)
else()
    conan_message(STATUS "Conan: Dependency ZLIB already found")
endif()


########## FIND LIBRARIES & FRAMEWORKS / DYNAMIC VARS #######################################
#############################################################################################

########## COMPONENT unwind FIND LIBRARIES & FRAMEWORKS / DYNAMIC VARS #############

set(libunwind_unwind_FRAMEWORKS_FOUND "")
conan_find_apple_frameworks(libunwind_unwind_FRAMEWORKS_FOUND "${libunwind_unwind_FRAMEWORKS}" "${libunwind_unwind_FRAMEWORK_DIRS}")

set(libunwind_unwind_LIB_TARGETS "")
set(libunwind_unwind_NOT_USED "")
set(libunwind_unwind_LIBS_FRAMEWORKS_DEPS ${libunwind_unwind_FRAMEWORKS_FOUND} ${libunwind_unwind_SYSTEM_LIBS} ${libunwind_unwind_DEPENDENCIES})
conan_package_library_targets("${libunwind_unwind_LIBS}"
                              "${libunwind_unwind_LIB_DIRS}"
                              "${libunwind_unwind_LIBS_FRAMEWORKS_DEPS}"
                              libunwind_unwind_NOT_USED
                              libunwind_unwind_LIB_TARGETS
                              ""
                              "libunwind_unwind")

set(libunwind_unwind_LINK_LIBS ${libunwind_unwind_LIB_TARGETS} ${libunwind_unwind_LIBS_FRAMEWORKS_DEPS})

set(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH})
set(CMAKE_PREFIX_PATH  ${CMAKE_PREFIX_PATH})

########## COMPONENT generic FIND LIBRARIES & FRAMEWORKS / DYNAMIC VARS #############

set(libunwind_generic_FRAMEWORKS_FOUND "")
conan_find_apple_frameworks(libunwind_generic_FRAMEWORKS_FOUND "${libunwind_generic_FRAMEWORKS}" "${libunwind_generic_FRAMEWORK_DIRS}")

set(libunwind_generic_LIB_TARGETS "")
set(libunwind_generic_NOT_USED "")
set(libunwind_generic_LIBS_FRAMEWORKS_DEPS ${libunwind_generic_FRAMEWORKS_FOUND} ${libunwind_generic_SYSTEM_LIBS} ${libunwind_generic_DEPENDENCIES})
conan_package_library_targets("${libunwind_generic_LIBS}"
                              "${libunwind_generic_LIB_DIRS}"
                              "${libunwind_generic_LIBS_FRAMEWORKS_DEPS}"
                              libunwind_generic_NOT_USED
                              libunwind_generic_LIB_TARGETS
                              ""
                              "libunwind_generic")

set(libunwind_generic_LINK_LIBS ${libunwind_generic_LIB_TARGETS} ${libunwind_generic_LIBS_FRAMEWORKS_DEPS})

set(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH})
set(CMAKE_PREFIX_PATH  ${CMAKE_PREFIX_PATH})

########## COMPONENT coredump FIND LIBRARIES & FRAMEWORKS / DYNAMIC VARS #############

set(libunwind_coredump_FRAMEWORKS_FOUND "")
conan_find_apple_frameworks(libunwind_coredump_FRAMEWORKS_FOUND "${libunwind_coredump_FRAMEWORKS}" "${libunwind_coredump_FRAMEWORK_DIRS}")

set(libunwind_coredump_LIB_TARGETS "")
set(libunwind_coredump_NOT_USED "")
set(libunwind_coredump_LIBS_FRAMEWORKS_DEPS ${libunwind_coredump_FRAMEWORKS_FOUND} ${libunwind_coredump_SYSTEM_LIBS} ${libunwind_coredump_DEPENDENCIES})
conan_package_library_targets("${libunwind_coredump_LIBS}"
                              "${libunwind_coredump_LIB_DIRS}"
                              "${libunwind_coredump_LIBS_FRAMEWORKS_DEPS}"
                              libunwind_coredump_NOT_USED
                              libunwind_coredump_LIB_TARGETS
                              ""
                              "libunwind_coredump")

set(libunwind_coredump_LINK_LIBS ${libunwind_coredump_LIB_TARGETS} ${libunwind_coredump_LIBS_FRAMEWORKS_DEPS})

set(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH})
set(CMAKE_PREFIX_PATH  ${CMAKE_PREFIX_PATH})

########## COMPONENT setjmp FIND LIBRARIES & FRAMEWORKS / DYNAMIC VARS #############

set(libunwind_setjmp_FRAMEWORKS_FOUND "")
conan_find_apple_frameworks(libunwind_setjmp_FRAMEWORKS_FOUND "${libunwind_setjmp_FRAMEWORKS}" "${libunwind_setjmp_FRAMEWORK_DIRS}")

set(libunwind_setjmp_LIB_TARGETS "")
set(libunwind_setjmp_NOT_USED "")
set(libunwind_setjmp_LIBS_FRAMEWORKS_DEPS ${libunwind_setjmp_FRAMEWORKS_FOUND} ${libunwind_setjmp_SYSTEM_LIBS} ${libunwind_setjmp_DEPENDENCIES})
conan_package_library_targets("${libunwind_setjmp_LIBS}"
                              "${libunwind_setjmp_LIB_DIRS}"
                              "${libunwind_setjmp_LIBS_FRAMEWORKS_DEPS}"
                              libunwind_setjmp_NOT_USED
                              libunwind_setjmp_LIB_TARGETS
                              ""
                              "libunwind_setjmp")

set(libunwind_setjmp_LINK_LIBS ${libunwind_setjmp_LIB_TARGETS} ${libunwind_setjmp_LIBS_FRAMEWORKS_DEPS})

set(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH})
set(CMAKE_PREFIX_PATH  ${CMAKE_PREFIX_PATH})

########## COMPONENT ptrace FIND LIBRARIES & FRAMEWORKS / DYNAMIC VARS #############

set(libunwind_ptrace_FRAMEWORKS_FOUND "")
conan_find_apple_frameworks(libunwind_ptrace_FRAMEWORKS_FOUND "${libunwind_ptrace_FRAMEWORKS}" "${libunwind_ptrace_FRAMEWORK_DIRS}")

set(libunwind_ptrace_LIB_TARGETS "")
set(libunwind_ptrace_NOT_USED "")
set(libunwind_ptrace_LIBS_FRAMEWORKS_DEPS ${libunwind_ptrace_FRAMEWORKS_FOUND} ${libunwind_ptrace_SYSTEM_LIBS} ${libunwind_ptrace_DEPENDENCIES})
conan_package_library_targets("${libunwind_ptrace_LIBS}"
                              "${libunwind_ptrace_LIB_DIRS}"
                              "${libunwind_ptrace_LIBS_FRAMEWORKS_DEPS}"
                              libunwind_ptrace_NOT_USED
                              libunwind_ptrace_LIB_TARGETS
                              ""
                              "libunwind_ptrace")

set(libunwind_ptrace_LINK_LIBS ${libunwind_ptrace_LIB_TARGETS} ${libunwind_ptrace_LIBS_FRAMEWORKS_DEPS})

set(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH})
set(CMAKE_PREFIX_PATH  ${CMAKE_PREFIX_PATH})


########## TARGETS ##########################################################################
#############################################################################################

########## COMPONENT unwind TARGET #################################################

if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
    # Target approach
    if(NOT TARGET libunwind::unwind)
        add_library(libunwind::unwind INTERFACE IMPORTED)
        set_target_properties(libunwind::unwind PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
                              "${libunwind_unwind_INCLUDE_DIRS}")
        set_target_properties(libunwind::unwind PROPERTIES INTERFACE_LINK_DIRECTORIES
                              "${libunwind_unwind_LIB_DIRS}")
        set_target_properties(libunwind::unwind PROPERTIES INTERFACE_LINK_LIBRARIES
                              "${libunwind_unwind_LINK_LIBS};${libunwind_unwind_LINKER_FLAGS_LIST}")
        set_target_properties(libunwind::unwind PROPERTIES INTERFACE_COMPILE_DEFINITIONS
                              "${libunwind_unwind_COMPILE_DEFINITIONS}")
        set_target_properties(libunwind::unwind PROPERTIES INTERFACE_COMPILE_OPTIONS
                              "${libunwind_unwind_COMPILE_OPTIONS_C};${libunwind_unwind_COMPILE_OPTIONS_CXX}")
    endif()
endif()

########## COMPONENT generic TARGET #################################################

if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
    # Target approach
    if(NOT TARGET libunwind::generic)
        add_library(libunwind::generic INTERFACE IMPORTED)
        set_target_properties(libunwind::generic PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
                              "${libunwind_generic_INCLUDE_DIRS}")
        set_target_properties(libunwind::generic PROPERTIES INTERFACE_LINK_DIRECTORIES
                              "${libunwind_generic_LIB_DIRS}")
        set_target_properties(libunwind::generic PROPERTIES INTERFACE_LINK_LIBRARIES
                              "${libunwind_generic_LINK_LIBS};${libunwind_generic_LINKER_FLAGS_LIST}")
        set_target_properties(libunwind::generic PROPERTIES INTERFACE_COMPILE_DEFINITIONS
                              "${libunwind_generic_COMPILE_DEFINITIONS}")
        set_target_properties(libunwind::generic PROPERTIES INTERFACE_COMPILE_OPTIONS
                              "${libunwind_generic_COMPILE_OPTIONS_C};${libunwind_generic_COMPILE_OPTIONS_CXX}")
    endif()
endif()

########## COMPONENT coredump TARGET #################################################

if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
    # Target approach
    if(NOT TARGET libunwind::coredump)
        add_library(libunwind::coredump INTERFACE IMPORTED)
        set_target_properties(libunwind::coredump PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
                              "${libunwind_coredump_INCLUDE_DIRS}")
        set_target_properties(libunwind::coredump PROPERTIES INTERFACE_LINK_DIRECTORIES
                              "${libunwind_coredump_LIB_DIRS}")
        set_target_properties(libunwind::coredump PROPERTIES INTERFACE_LINK_LIBRARIES
                              "${libunwind_coredump_LINK_LIBS};${libunwind_coredump_LINKER_FLAGS_LIST}")
        set_target_properties(libunwind::coredump PROPERTIES INTERFACE_COMPILE_DEFINITIONS
                              "${libunwind_coredump_COMPILE_DEFINITIONS}")
        set_target_properties(libunwind::coredump PROPERTIES INTERFACE_COMPILE_OPTIONS
                              "${libunwind_coredump_COMPILE_OPTIONS_C};${libunwind_coredump_COMPILE_OPTIONS_CXX}")
    endif()
endif()

########## COMPONENT setjmp TARGET #################################################

if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
    # Target approach
    if(NOT TARGET libunwind::setjmp)
        add_library(libunwind::setjmp INTERFACE IMPORTED)
        set_target_properties(libunwind::setjmp PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
                              "${libunwind_setjmp_INCLUDE_DIRS}")
        set_target_properties(libunwind::setjmp PROPERTIES INTERFACE_LINK_DIRECTORIES
                              "${libunwind_setjmp_LIB_DIRS}")
        set_target_properties(libunwind::setjmp PROPERTIES INTERFACE_LINK_LIBRARIES
                              "${libunwind_setjmp_LINK_LIBS};${libunwind_setjmp_LINKER_FLAGS_LIST}")
        set_target_properties(libunwind::setjmp PROPERTIES INTERFACE_COMPILE_DEFINITIONS
                              "${libunwind_setjmp_COMPILE_DEFINITIONS}")
        set_target_properties(libunwind::setjmp PROPERTIES INTERFACE_COMPILE_OPTIONS
                              "${libunwind_setjmp_COMPILE_OPTIONS_C};${libunwind_setjmp_COMPILE_OPTIONS_CXX}")
    endif()
endif()

########## COMPONENT ptrace TARGET #################################################

if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
    # Target approach
    if(NOT TARGET libunwind::ptrace)
        add_library(libunwind::ptrace INTERFACE IMPORTED)
        set_target_properties(libunwind::ptrace PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
                              "${libunwind_ptrace_INCLUDE_DIRS}")
        set_target_properties(libunwind::ptrace PROPERTIES INTERFACE_LINK_DIRECTORIES
                              "${libunwind_ptrace_LIB_DIRS}")
        set_target_properties(libunwind::ptrace PROPERTIES INTERFACE_LINK_LIBRARIES
                              "${libunwind_ptrace_LINK_LIBS};${libunwind_ptrace_LINKER_FLAGS_LIST}")
        set_target_properties(libunwind::ptrace PROPERTIES INTERFACE_COMPILE_DEFINITIONS
                              "${libunwind_ptrace_COMPILE_DEFINITIONS}")
        set_target_properties(libunwind::ptrace PROPERTIES INTERFACE_COMPILE_OPTIONS
                              "${libunwind_ptrace_COMPILE_OPTIONS_C};${libunwind_ptrace_COMPILE_OPTIONS_CXX}")
    endif()
endif()

########## GLOBAL TARGET ####################################################################

if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
    if(NOT TARGET libunwind::libunwind)
        add_library(libunwind::libunwind INTERFACE IMPORTED)
    endif()
    set_property(TARGET libunwind::libunwind APPEND PROPERTY
                 INTERFACE_LINK_LIBRARIES "${libunwind_COMPONENTS}")
endif()

########## BUILD MODULES ####################################################################
#############################################################################################
########## COMPONENT unwind BUILD MODULES ##########################################

foreach(_BUILD_MODULE_PATH ${libunwind_unwind_BUILD_MODULES_PATHS})
    include(${_BUILD_MODULE_PATH})
endforeach()
########## COMPONENT generic BUILD MODULES ##########################################

foreach(_BUILD_MODULE_PATH ${libunwind_generic_BUILD_MODULES_PATHS})
    include(${_BUILD_MODULE_PATH})
endforeach()
########## COMPONENT coredump BUILD MODULES ##########################################

foreach(_BUILD_MODULE_PATH ${libunwind_coredump_BUILD_MODULES_PATHS})
    include(${_BUILD_MODULE_PATH})
endforeach()
########## COMPONENT setjmp BUILD MODULES ##########################################

foreach(_BUILD_MODULE_PATH ${libunwind_setjmp_BUILD_MODULES_PATHS})
    include(${_BUILD_MODULE_PATH})
endforeach()
########## COMPONENT ptrace BUILD MODULES ##########################################

foreach(_BUILD_MODULE_PATH ${libunwind_ptrace_BUILD_MODULES_PATHS})
    include(${_BUILD_MODULE_PATH})
endforeach()
